home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: sin function in Turbo C 3
- Date: 28 Feb 1996 15:20 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <28FEB199615204861@erich.triumf.ca>
- References: <4h2al3$rim@mulgave.octacon.co.uk>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4h2al3$rim@mulgave.octacon.co.uk>, Nik.Palmer@onyx.octacon.co.uk (Nik Palmer) writes...
- >Hi easy question first,
- >when findng the angle in trigonometry on my calc I use the sin-1
- >function to give me the answer in degrees a la
- >
- >sin(theta)=opp/hyp
- >
- >but Turbo C only has the sin function how do I get the answer in
- >degrees(or radians)
-
- Look at asin() and acos()
-
- >Q2
- >when dividing doubles using the / function I would like to have the
- >answer in the form 10/3 = 3.3333etc like I know I lose the fraction,
- >I can get around this using the other functions which provide me with
- >the remiander to redivide, or multiply the number to be divided by
- >1000 then do some bits to get the result.
-
- division with doubles using "/" should give a decimal result.
-
- However, "10/3" will be done with ints because constants with no decimal
- places _are_ ints (therefore, no fraction on the result). To force the
- division to be done with floats or doubles, make your constants floats,
- like: 10.0/3.0
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-
-
-
-
-